package Gamedemo;

public class player extends Role implements Weapon{
    int weapon;
    int hp;
    int energy;
    int aggressivity;//攻击力


    public player()
    {

    }

    public player(int weapon, int hp, int energy,int aggressivity) {
        this.weapon = weapon;
        this.hp = hp;
        this.energy = energy;
        this.aggressivity=aggressivity;
    }

    public player(String name,int id,int grade, int maxHp, int maxenergy, int weapon, int hp, int energy,int aggressivity) {
        super(name,id, grade,maxHp, maxenergy);
        this.weapon = weapon;
        this.hp = hp;
        this.energy = energy;
        this.aggressivity=aggressivity;
    }

    @Override
    public void knife() {
        System.out.println(name+"使用了气刃大回旋");
    }

    @Override
    public void Swordshield() {
        System.out.println(name+"使用了超高出力属性解放斩");
    }

    @Override
    public void Flute() {
        System.out.println(name+"使用了狩猎笛演奏");
    }

    @Override
    public void Stick() {
        System.out.println(name+"使用了三灯飞天虫棍");
    }

    @Override
    public void Attack() {
        switch (weapon)
        {
            case 1:knife();
                break;
            case 2:Swordshield();
                break;
            case 3:Flute();
                break;
            case 4:Stick();
                break;
        }
    }

    public void Attack(int id)
    {
        switch (weapon)
        {
            case 1:knife();
                break;
            case 2:Swordshield();
                break;
            case 3:Flute();
                break;
            case 4:Stick();
                break;
        }
    }

    @Override
    public void aggressivity(int aggressivity) {
        this.aggressivity=aggressivity;
    }


    public void setWeapon(int weapon)//换武器
    {
        this.weapon=weapon;
    }
    public String weaponmane()
    {
        switch (weapon)
        {
            case 1:return "太刀";
            case 2:return "盾斧";
            case 3:return "狩猎笛";
            case 4:return "虫棍";
        }
        return null;
    }

    @Override
    public String toString() {
        return "player{" +
                ", name='" + name +
                "id="+id+
                '\'' +
                ", Grade=" + Grade +
                ", MaxHp=" + MaxHp +
                ", Maxenergy=" + Maxenergy +
                "武器是" + weaponmane() +
                ", hp=" + hp +
                ", energy=" + energy +
                ", aggressivity=" + aggressivity +
                '}';
    }
}
